﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Water.Resources.Globalize;
using System.Threading;
namespace Water.Web.Controls.Design
{
    public partial class RichTextEditorForm : Form
    {
        //private string richText;

        public string RichText
        {
            get { return this.richTextBox1.Text; }
            set { this.richTextBox1.Text = value; }
        }

        public RichTextEditorForm()
        {
            InitializeComponent();
            SetLocal();
        }

        public RichTextEditorForm(string value)
        {
            InitializeComponent();
            this.richTextBox1.Text = value;
            SetLocal();
        }

        private void SetLocal()
        {
            AssemblyResourceManager.DescriptionResource.GetString("Button_ok",Thread.CurrentThread.CurrentCulture);
            this.btn_ok.Text = AssemblyResourceManager.DescriptionResource.GetString("Button_ok", Thread.CurrentThread.CurrentCulture);
            this.btn_Cancel.Text = AssemblyResourceManager.DescriptionResource.GetString("Button_cancel", Thread.CurrentThread.CurrentCulture);
            this.btn_calcel_fromat.Text = AssemblyResourceManager.DescriptionResource.GetString("Button_not_format", Thread.CurrentThread.CurrentCulture);
            this.Text = AssemblyResourceManager.DescriptionResource.GetString("RichTextEditorForm_title", Thread.CurrentThread.CurrentCulture); 
        }

        private void btn_ok_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void btn_Cancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void btn_calcel_fromat_Click(object sender, EventArgs e)
        {
            this.richTextBox1.Text = this.richTextBox1.Text.Replace("\n"," ");
        }
    }
}
